package com.my.study.designPatterns.compoundPattern;

public class DuckSimulatorOnPattern {

    public static void main(String[] args) {

        DuckSimulatorOnPattern duckSimulatorOnPattern = new DuckSimulatorOnPattern();
        duckSimulatorOnPattern.simulate();

    }

    public void simulate(){
        Quackable green = new GreenHeadDuck();
        Quackable red = new RedHeadDuck();
        Quackable yellow = new YellowHeadDuck();

        System.out.println("------DuckSimulatorOnePattern---------");
        makeQuack(green);
        makeQuack(red);
        makeQuack(yellow);

    }


    public void makeQuack(Quackable quackable){

        quackable.quack();
    }

}
